<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <div class="table-responsive">
        <div class="col-sm-12">
            <div class="pt10 text-right">
                <form id="search-form-answer" role="form" class="form-inline">
                    <div class="form-group" style="margin-bottom: 10px">
                        <input placeholder="开始时间" id="start" name="startTime" class="laydate-icon form-control layer-date" type="text" th:value="${startTime}">
                    </div>
                    <div class="form-group" style="margin-bottom: 10px">
                        <input placeholder="结束时间" id="end" name="endTime" class="laydate-icon form-control layer-date" type="text" th:value="${endTime}">
                    </div>
                    <button id="search-answer" class="btn btn-w-m btn-primary submitIntegralList" type="button" style="margin-bottom: 10px">搜索</button>
                </form>
            </div>
        </div>
        <table class="table table-bordered">
            <thead>
            <tr>
                <th class="text-center" width="10%">序号</th>
                <th class="text-center" width="15%">回答时间</th>
                <th class="text-center" width="35%">针对问题</th>
                <th class="text-center" width="10%">提问人</th>
                <th class="text-center" width="10%">问题价格</th>
                <th class="text-center" width="10%">收益</th>
                <th class="text-center" width="10%">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                <td colspan="6" class="text-center">
                    <div class="noDataTipsBox">
                        <p><span class="c-4e fs16">亲，还没有回答数据~~~</span></p>
                    </div>
                </td>
            </tr>

            <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="question: ${dataMap['list']}">
                <td class="text-center" th:text="${question['id']}"></td>
                <td class="text-center" th:text="${#strings.substring(question['replyTime'],0,16)}"></td>
                <td class="text-center" th:text="${question['context']}"></td>
                <td class="text-center" th:text="${question['user']['nickname']}"></td>
                <td class="text-center"><i class="fa fa-cny" th:text="' ' + ${question['price']}"></i></td>
                <td class="text-center" ><th:block th:text="${question['qaTeacherCommission']} == null ? 0.0 : ${question['qaTeacherCommission']['price']}"></th:block></td>
                <td class="text-center">
                    <a href="javascript:void(0);" id="question-info" th:attr="data-id=${question['id']},data-isfree=${question['isFree']}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="查看问题">
                        <i class="fa fa-eye"></i>
                    </a>
                    <a href="javascript:void(0);" id="user-info" th:attr="data-id=${question['user']['id']}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="查看学员">
                        <i class="fa fa-user"></i>
                    </a>
                </td>
            </tr>

            </tbody>
        </table>
        <!-- 分页，开始 -->
        <div data-th-replace="layout/adminPage"></div>
        <!-- 分页，结束 -->
    </div>
    <script>
        var start = {
            elem: '#start',
            format: 'YYYY-MM-DD hh:mm',
            istime: true,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY-MM-DD hh:mm',
            istime: true,
            choose: function (datas) {
                start.max = datas //将结束日的初始值设定为开始日
            }
        };
        laydate(start);
        laydate(end);
    </script>
</html>